package com.cari.oa.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
@Entity
@Table(name = "T_ATTACHMENT")
public class AttachmentEntity implements Serializable{
	
	private static final long serialVersionUID = 1604406583312833811L;

	@Id
    @Length(max = 32)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
	private String id;
	
	@NotNull(message = "附件名称不能为空")
    @Length(max = 50, message = "附件名称长度要小于50个字符")
    @Column(name = "name")
	private String name;
	
	@NotNull(message = "附件路径不能为空")
    @Length(max = 512, message = "附件路径长度要小于512个字符")
    @Column(name = "path")
	private String path;
	
	@NotNull(message = "创建时间不能为空")
    @Column(name = "create_time")
	private Date createTime = new Date();
	
	@NotNull(message = "创建时间不能为空")
    @Column(name = "upload_user")
	private String uploadUser;
	
	@Column(name="suffix")
	private String suffix;
	
	@Column(name="object_id")
	@NotNull(message="对象的ID不能为空")
	private String objectId;
	
	@Column(name="object_type")
	@NotNull(message="对象类型不能为空")
	private Integer objectType;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getUploadUser() {
		return uploadUser;
	}
	public void setUploadUser(String uploadUser) {
		this.uploadUser = uploadUser;
	}
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	public String getObjectId() {
		return objectId;
	}
	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}
	public Integer getObjectType() {
		return objectType;
	}
	public void setObjectType(Integer objectType) {
		this.objectType = objectType;
	}
}
